#pragma once
/*--------------------------------------------------------------------------------
 * Adaptive Intelligence - Foundation Framework Class Library
 * Version 2.00
 * 
 * Accepted Socket Event Argument Class
 *      Provides an event arguments definition for newly accepted Socket connection events.
 *------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------
 * System Imports
 *------------------------------------------------------------------------------*/
#include "stdafx.h"
#include "SafeSocketHandle.h"

using namespace System;

namespace Adaptive
{
	namespace Network
	{
		namespace Sockets
		{
			/// <summary>
			/// Provides an event arguments definition for newly accepted Socket connection events.
			/// </summary>
			public ref class AcceptedSocketEventArgs : public System::EventArgs 
			{
			public:
				/*--------------------------------------------------------------------------------
				 * Constructor / Dispose / Destructor Methods
				 *------------------------------------------------------------------------------*/
				#pragma region Constructor / Dispose / Destructor Methods
				/// <summary>
				/// Initializes a new instance of the class.
				/// </summary>
				/// <param name="socketHandle">
				/// The newly connection <see cref="SafeSocketHandle"/> instance.
				/// </param>
				AcceptedSocketEventArgs(SafeSocketHandle^ socketHandle);
				/// <summary>
				/// Class destructor.
				/// </summary>
				~AcceptedSocketEventArgs();
				#pragma endregion
				
				/*--------------------------------------------------------------------------------
				 * Public Properties
				 *------------------------------------------------------------------------------*/
				#pragma region Public Properties
				/// <summary>
				/// Gets the reference to the newly connected socket communications instance.
				/// </summary>
				/// <value>
				/// A <see cref="SafeSocketHandle"/> instance.
				/// </value>
				property SafeSocketHandle^ SocketConnection { SafeSocketHandle^ get(); }
				#pragma endregion

			private:
				/*--------------------------------------------------------------------------------
				 * Private Member Declarations
				 *------------------------------------------------------------------------------*/
				#pragma region Private Member Declarations

				SafeSocketHandle^ _connectedSocket;

				#pragma endregion

			};
		}
	}
}
